//
//  JSTInterestcircleCell.m
//  KYKJPackDemo
//
//  Created by 01 on 17/5/9.
//  Copyright © 2017年 ???. All rights reserved.
//

#import "JSTInterestcircleCell.h"
#import "JSTInterestcicleView.h"
#import "JSTInterestcircleDataFrame.h"

@interface JSTInterestcircleCell ()<JSTInterestcircleViewDelegate>

@property (nonatomic, strong) JSTInterestcicleView *interestcicleView;

@end

@implementation JSTInterestcircleCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (id) initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier])
    {
        JSTInterestcicleView *interestcicleView = [[JSTInterestcicleView alloc] init];
        interestcicleView.delegate = self;
        [self.contentView addSubview:interestcicleView];
        self.interestcicleView = interestcicleView;
    }
    return self;
}

- (void)setDataFrame:(JSTInterestcircleDataFrame *)dataFrame
{
    _dataFrame = dataFrame;
    
    self.interestcicleView.interestcircleFrame = dataFrame.interestcircleFrame;
}

- (void)changeCommetnPage:(NSString *)commentIndex
{
    if (_delegate && [_delegate respondsToSelector:@selector(onclickChangePage:)])
    {
        [_delegate onclickChangePage:commentIndex];
    }
}

- (void)praiseOnclick:(NSString *)comentIndex
{
    if (_delegate && [_delegate respondsToSelector:@selector(onclickPraise:)])
    {
        [_delegate onclickPraise:comentIndex];
    }
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
}

@end
